[SIL][PackageCMO] Fix dispatch thunk linker error and update table serialization #74070
Merged
[SIL][PackageCMO] Fix dispatch thunk linker error and update table serialization #74070
Conversation
* Do not use [serialized_for_package] for witness method before Package CMO.
* Update v-table and witness-table and their entry serialization.
-- Allow non-serialized but visible entries in a serialized table so they
can be optimized by other SIL opt passes.
* Only serialize MethodInst if it has the right visibility.
Resolves rdar://129089105&129088935
Contributor
Author
|
@swift-ci test |
aschwaighofer
approved these changes
Jun 3, 2024
Contributor
aschwaighofer
left a comment
There was a problem hiding this comment.
This looks reasonable to me.
acknowleding that there will be a future patch that:
- does not set the serialized attribute for package serialization in SILGen
- implement a systematic way (refactoring a type and a decl visitor for instructions as @slavapestov has eluded to earlier) to find instructions that block package serialization
this can be done in later PRs
nkcsgexi
reviewed
Jun 3, 2024
| return !method->hasValidLinkageForFragileRef(getRightSerializedKind(M)); | ||
| }); | ||
| if (!containsInternal) | ||
| wt.setSerializedKind(getRightSerializedKind(M)); |
Contributor
There was a problem hiding this comment.
the logics for serializing v-table and w-table are very much alike. Can we extract a common function to handle both?
Contributor
Author
There was a problem hiding this comment.
Some of these checks might not be necessary but added as a caution as mentioned in the comments; will follow up and remove them if found to be unnecessary.
Update lambda in table serialization. Add more tests.
Contributor
Author
|
@swift-ci test |
Contributor
|
Does this PR #73902 need to be merged first? It seems this PR would have a dependency on it. |
Contributor
Author
yup, merged. |
Contributor
Author
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves rdar://129089105&129088935